<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>{$_title}</h2>
    </div>
    <notempty name="note" >
    	<form action="{:U('Global/editNote')}" method="post" class="form-horizontal">
    		<input type="hidden" name="id" value="{$note.id}" />
    <else />
	    <form action="{:U('Global/addNote')}" method="post" class="form-horizontal">
    </notempty>
        <div class="form-item">
            <label class="item-label">名称<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="name" value="{$note.name|default=''}">
            </div>
            <input type="hidden" name="super" value="{:I('super')}"/>
        </div>
        
        <div class="form-item">
            <label class="item-label">类型<span class="check-tips"></span></label>
            <div class="controls">
            	<select name="type" class="input-large">
            		<notempty name="type">
            			<foreach name="type" key="key" item="val">
	            			<if condition="$key eq $note['type']">
			            		<option value="{$key}" selected>{$val}</option>
			            	<else />
	            				<option value="{$key}">{$val}</option>
	            			</if>
            			</foreach>
            		</notempty>
            	</select>
            </div>
        </div>
    <div class="form-item">
        <label class="item-label">是否判断登录<span class="check-tips"></span></label>
        <div class="controls">
            <input type="radio" name="is_login_push" value="false"   <eq name="note.is_login_push" value="false">checked</eq> /> 否
            <input type="radio" name="is_login_push" value="true" <eq name="note.is_login_push" value="true">checked</eq> /> 是
        </div>
    </div>
        <div class="form-item">
            <label class="item-label">分类描述<span class="check-tips"></span></label>
            <div class="controls">
            	<textarea class="input-large kind-editor" name="content">{$note.content|default=''}</textarea>
            </div>
        </div>

        <div class="form-item">
            <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
</block>
<block name="style">
	<link rel="stylesheet" href="__PUBLIC__/static/kindeditor/default/default.css" />
</block>
<block name="script">
<script charset="utf-8" src="__PUBLIC__/static/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="__PUBLIC__/static/kindeditor/zh_CN.js"></script>
<script type="text/javascript">
    KindEditor.ready(function(K) {
		window.editor = K.create('textarea[class="kind-editor"]', {
			//allowFileManager : false
			minWidth:900,
			minHeight:300,
			afterBlur: function(){this.sync();},
		});
	});
	//导航高亮
	 highlight_subnav('{:U("Global/"."$action")}');
</script>
</block>
